/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 move_missile.h

	$Header: /heroes4/move_missile.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( MOVE_MISSILE_H_INCLUDED )
#define MOVE_MISSILE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_creature_ptr.h"
#include "counted_animation.h"
#include "counted_idle_processor.h"
#include "handler.h"
#include "map_point.h"
#include "missile_handler.h"

class t_battlefield;
class t_combat_actor;
class t_combat_creature;

// -----------------------------------------------------------------
// class to move a missile across the battlefield
// -----------------------------------------------------------------

class t_move_missile : public t_counted_idle_processor, public t_counted_animation
{
public:
	t_move_missile( t_combat_actor&			missile, 
		            t_combat_creature&		attacker, 
					t_map_point_3d const&	target_position,
					bool					parabolic,
					t_missile_handler		end_handler );
	virtual void on_idle();
protected:
	t_combat_creature_ptr		m_attacker;
	t_uint32					m_delay;
	t_map_point_3d				m_delta;
	int							m_distance;
	int							m_distance_left;
	t_missile_handler           m_end_handler;
	bool						m_is_parabolic;
	t_uint32					m_last_update_time;
	t_combat_actor&				m_missile;
	int							m_move_distance;
	t_map_point_3d				m_sum;
	int							m_vertical_velocity;
	t_map_point_3d			    m_target_position;
};

#endif // MOVE_MISSILE_H_INCLUDED